<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../config/config.jsp"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page
	import="java.util.*,com.cinema.Bean.*,com.cinema.dao.*,com.cinema.dao.imp.*"%>
<%@ page import="java.io.*,java.util.*"%>
<%@ page import="javax.servlet.*,java.text.*"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>购票结果</title>
<link rel="stylesheet" href="<%=basePath%>/css/bootstrap.min.css" />
<link rel="stylesheet" href="<%=basePath%>/css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="<%=basePath%>/css/index.css" />
<script type="text/javascript" src="<%=basePath%>js/jquery-3.2.1.min.js"></script>
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<style>
body {
	background: #fafafa;
}

.content {
	min-width: 960px;
	height: 520px;
	border: 1px solid #d3d3d3;
	margin: 90px auto 0 auto;
	border-radius: 5px;
}

.content_box {
	margin: 0 auto;
	width: 600px;
	height: 500px;
}

.ticket {
	width: 387px;
	padding: 10px 0;
	position: relative;
	overflow: hidden;
	background-image: linear-gradient(to right, rgb(255, 15, 75) 10%,
		rgb(255, 92, 133) 90%);
	margin: 50px;
	margin-bottom:30px;
	border: 1px solid #d3d3d3;
}

.logoBg {
	background: #fafafa;
	padding: 5px 10px;
	display: inline-block;
	margin: 10px 0;
	border-radius: 0 10px 10px 0;
}

p {
	background: #fff;
	padding: 5px 20px;
	margin: 5px 20px;
	border-radius: 8px;
}
</style>

</head>
<body>
	<!--头部导航-->
	<nav class="navbar navbar-default navbar-fixed-top nav-min-height">
		<div class="container">
			<div class="navbar-header nav-min-height">
				<a href="#" class="navbar-brand logo"><img
					src="<%=basePath%>/images/logo.png" alt=""></a>
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target="#navbar-collapse">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
			</div>
			<div class="collapse navbar-collapse  nav-min-height"
				id="navbar-collapse">
				<ul class="nav navbar-nav navbar-right  nav-min-height">
					<li><a href="<%=basePath%>/indexServlet"><span
							class="glyphicon glyphicon-home"></span> 首页</a></li>
					<li><a href="#userBalanceModal" id="getBalanInfo"
						data-toggle="modal" data-target="#userBalanceModal"> <span
							class="glyphicon glyphicon-user"></span>
							${sessionScope.loginUser.userName}
					</a></li>
				</ul>
			</div>
		</div>
	</nav>

	<div class="container content">
		<div class="content_box">
			<h2>出票成功！</h2>
			<div class="ticket">
				<%
					List<Map<String, Object>> movieMessage = (List<Map<String, Object>>) request.getAttribute("movieMessage");
					for (int i = 0; i < movieMessage.size(); i++) {
						Map<String, Object> obj = movieMessage.get(i);
						MovieSession ms = (MovieSession) obj.get("movieSession");
						Hall hall = (Hall) obj.get("hall");
						Movie movie = (Movie) obj.get("movie");
						SimpleDateFormat ftDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm");
						String time = ftDateTime.format(ftDateTime.parse(ms.getTime()));
				%>
				<div class="par">
					<div class="logoBg">
						<img src="<%=basePath%>images/logo.png" />
					</div>
					<p>
						影片：<%=movie.getMovieName()%></p>
				</div>
				<div class="copy">
					<p>
						影厅：<%=hall.getHallName()%></p>
					<p>
						时间：<%=time%></p>
					<p>
						单价：<%=ms.getPrice()%></p>
					<p>数量：${buyedTickets.size() }</p>
					<p>
						座位：
						<c:forEach items="${buyedTickets }" var="buyed">${buyed.seatRow}排${buyed.seatCol}座 </c:forEach>
					</p>
					<%
						}
					%>

				</div>
			</div>
			<div><a href="<%=basePath%>/indexServlet" class="btn btn-success pull-right">返回首页</a></div>
		</div>
	</div>
</body>
</html>